currentDateTimeString

fun LocalDateTime.currentDateTimeString(pattern: String = "hh:mm:ss"): String

Extension function to format a LocalDateTime object as a string.

Return

The formatted date-time string.

Example usage:

val dateTimeString = LocalDateTime.now().currentDateTimeString("yyyy-MM-dd hh:mm:ss")

Parameters

pattern

The pattern to format the date-time string.